package com.kpmg.datalake.operatelog.enums;

/**
 * @author Alex.zhao [alex.zhao@kpmg.com]
 * @since Created on azhao6 on 2018-08-14 21:21:09
 * 日志类型
 */
public enum LogTypeEnum {
    /**
     * 系统日志
     */
    SYSTEM("system", "系统日志"),
    /**
     * 安全日志
     */
    SECURITY("security", "安全日志"),
    /**
     * 操作日志
     */
    OPERATION("operation", "操作日志");

    private String code;
    private String display;

    LogTypeEnum(String code, String display) {
      this.code = code;
      this.display = display;
    }

  public static String getNameByCode(String code) {
    if(code == null){
      return "";
    }

    for (LogTypeEnum c : LogTypeEnum.values()) {
      if (c.getCode().equals(code)) {
        return c.getDisplay();
      }
    }
    return "";
  }

    public String getCode() {
      return code;
    }

    public String getDisplay() {
      return display;
    }
}
